#ifndef MYRECT_H
#define MYRECT_H
#include <QWidget>
#include <QRectF>
#include <QString>
#include <QVector>
#include <QPainter>
#include <QPaintEvent>
#include <QSharedPointer>

//显示当前的width和height
class MyRect : public QWidget
{
    Q_OBJECT
public:
    MyRect(QWidget *parent = 0);

    void setText(QString str);
    void setLocation(qreal x, qreal y);

    virtual void paintEvent(QPaintEvent *e);


private:
    QString text;

    QSharedPointer <QPixmap> mbackgroundPixmap;
};

#endif // MYRECT_H
